/**
 * @type {import('@vue/cli-service').ProjectOptions}
 */
 const webpack = require('webpack')
 const path = require("path");
 function resolve(dir) {
   return path.join(__dirname, dir);
 }
 
module.exports = {
  // publicPath: '/',
  devServer: {
    //代理
    proxy: {
      "/api/": {
        target: "https://www.fastmock.site/mock/f3f10a1d86d452eefbcf5abb53ccd067",
        changeOrigin: true,
        pathRewrite: {
          "^/api": "/api",
        }
      }
    },
  },
  //不需要生产环境的 source map，将其设置为 false 以加速生产环境构建
  productionSourceMap: false,
  runtimeCompiler: true,
  // 选项...
  // module: {
  //   rules: [{
  //     test: /.less$/,
  //     use: [{
  //       loader: "less-loader",
  //       options: {
  //         lessOptions: {
  //           strictMath: true,
  //           noIeCompat: true
  //         }
  //       }
  //     }]
  //   }]
  // },
  chainWebpack: config => {
    config.resolve.alias.set('@', resolve('src'))
  },
  configureWebpack: {
    plugins: [
      new webpack.ProvidePlugin({
        $: 'jquery',
        jquery: 'jquery',
        'window.jQuery': 'jquery',
        jQuery: 'jquery'
      })
    ]
  },
};
